package com.atguigu.adapter.objectadapter;


/**
 * @author LYJ
 * @Description  将Voltage220V聚合到此类中
 * @date 2021 年 09 月 16 日 下午4:31
 */
public class VoltageAdapter implements Voltage5V {
    private Voltage220V voltage220V;

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int out5V() {
        System.out.println("开始适配220v");
        int res = voltage220V.out220V() / 44;
        System.out.println("适配完成,返回5V电流");
        return res;
    }

}
